package BookTest;

import java.util.Scanner;

public class G1Test {
    public static void main(String[] args) {
        try {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入一个整数：");
            int a = sc.nextInt();
            System.out.println("请输入另一个整数：");
            int b = sc.nextInt();
            int c = a + b;
            int d = a - b;
            int e = a * b;
            double f = a / b;
            System.out.println("加法"+c+"减法"+d+"乘法"+e+"除法"+f);
        }
        catch (ArithmeticException e) {
            System.out.println("输入的不是整数");
        }
        catch (Exception e) {
            System.out.println("输入的不是整数");
        }
        finally{
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入一个整数：");
            int a = sc.nextInt();
            System.out.println("请输入另一个整数：");
            int b = sc.nextInt();
            int c = a + b;
            int d = a - b;
            int e = a * b;
            double f = a / b;
            System.out.println("加法"+c+"减法"+d+"乘法"+e+"除法"+f);
        }
    }
}
